package com.hqq.service.impl;

import com.hqq.dao.StudentDao;
import com.hqq.entity.Student;
import com.hqq.service.StudentService;

import java.util.List;

public class StudentServiceImpl implements StudentService {

    private StudentDao studentDao;

    //使用set注入
    public void setStudentDao(StudentDao studentDao) {
        this.studentDao = studentDao;
    }

    @Override
    public int addStudent(Student student) {
       int num =studentDao.insertStudent(student);
       return num;

    }

    @Override
    public List<Student> queryStudent() {

        List<Student> students = studentDao.SelectStudents();
        return students;
    }
}
